public class PersonSortable implements Comparable<PersonSortable>{
    private String name;
    private int age;
    PersonSortable(String name,int age){
        this.name = name;
        this.age = age;
    }
    @Override
    public int compareTo(PersonSortable o) {
        if(this.name.compareTo(o.name) != 0){
            if(this.name.compareTo(o.name) > 0)
                return 1;
            else
                return -1;
        }
        else{
            if(this.age > o.age)
                return 1;
            else
                return -1;
        }
    }
    public String toString(){
        return name + '-' + age;
    }

}
